import request from "../utils/request";


// TODO:从后台获取学生数据
// export const getStudentList = () => request<any, any>({
//   url: '/student/list',
//   method: 'get',
// })

// export const updateStudent = (stu:IStudent)=>request.post('/student/update', stu)

// 模拟获取学生数据
export const getStudentList = (currentPage:number, pageSize:number) => {
    const students: IStudent[] = [
        {
            id: "1",
            stuNo: 1001,
            name: "张三",
            photo: "https://example.com/photo1.jpg",
            age: 20,
            phone: "13800000001",
            email: "zhangsan@example.com",
            address: "北京市海淀区",
            classNo: "CS101",
            major: "计算机科学",
            college: "计算机学院",
            selectedCorse: "数据结构",
            remark: "学习积极"
        },
        {
            id: "2",
            stuNo: 1002,
            name: "李四",
            photo: "https://example.com/photo2.jpg",
            age: 21,
            phone: "13800000002",
            email: "lisi@example.com",
            address: "上海市浦东新区",
            classNo: "CS102",
            major: "计算机科学",
            college: "计算机学院",
            selectedCorse: "算法分析",
            remark: "擅长编程"
        },
        {
            id: "3",
            stuNo: 1003,
            name: "王五",
            photo: "https://example.com/photo3.jpg",
            age: 22,
            phone: "13800000003",
            email: "wangwu@example.com",
            address: "广州市天河区",
            classNo: "CS103",
            major: "软件工程",
            college: "计算机学院",
            selectedCorse: "数据库系统",
            remark: "积极参与活动"
        },
        {
            id: "4",
            stuNo: 1004,
            name: "赵六",
            photo: "https://example.com/photo4.jpg",
            age: 23,
            phone: "13800000004",
            email: "zhaoliu@example.com",
            address: "深圳市南山区",
            classNo: "CS104",
            major: "信息安全",
            college: "计算机学院",
            selectedCorse: "网络安全",
            remark: "对安全有浓厚兴趣"
        },
        {
            id: "5",
            stuNo: 1005,
            name: "孙七",
            photo: "https://example.com/photo5.jpg",
            age: 20,
            phone: "13800000005",
            email: "sunqi@example.com",
            address: "成都市锦江区",
            classNo: "CS105",
            major: "人工智能",
            college: "计算机学院",
            selectedCorse: "机器学习",
            remark: "喜欢挑战"
        },
        {
            id: "6",
            stuNo: 1006,
            name: "周八",
            photo: "https://example.com/photo6.jpg",
            age: 21,
            phone: "13800000006",
            email: "zhoubai@example.com",
            address: "武汉市洪山区",
            classNo: "CS106",
            major: "计算机科学",
            college: "计算机学院",
            selectedCorse: "计算机图形学",
            remark: "擅长设计"
        },
        {
            id: "7",
            stuNo: 1007,
            name: "吴九",
            photo: "https://example.com/photo7.jpg",
            age: 22,
            phone: "13800000007",
            email: "wujiao@example.com",
            address: "南京市秦淮区",
            classNo: "CS107",
            major: "软件工程",
            college: "计算机学院",
            selectedCorse: "移动开发",
            remark: "有应用开发经验"
        },
        {
            id: "8",
            stuNo: 1008,
            name: "郑十",
            photo: "https://example.com/photo8.jpg",
            age: 23,
            phone: "13800000008",
            email: "zhengshi@example.com",
            address: "长沙市芙蓉区",
            classNo: "CS108",
            major: "信息安全",
            college: "计算机学院",
            selectedCorse: "信息系统",
            remark: "注重团队合作"
        },
        {
            id: "9",
            stuNo: 1009,
            name: "冯十一",
            photo: "https://example.com/photo9.jpg",
            age: 20,
            phone: "13800000009",
            email: "fengshi@example.com",
            address: "天津市和平区",
            classNo: "CS109",
            major: "人工智能",
            college: "计算机学院",
            selectedCorse: "自然语言处理",
            remark: "爱好阅读"
        },
        {
            id: "10",
            stuNo: 1010,
            name: "陈十二",
            photo: "https://example.com/photo10.jpg",
            age: 21,
            phone: "13800000010",
            email: "chenshi@example.com",
            address: "青岛市市南区",
            classNo: "CS110",
            major: "计算机科学",
            college: "计算机学院",
            selectedCorse: "人工智能导论",
            remark: "乐于助人"
        },
        {
            id: "11",
            stuNo: 1011,
            name: "褚十三",
            photo: "https://example.com/photo11.jpg",
            age: 22,
            phone: "13800000011",
            email: "chushisan@example.com",
            address: "哈尔滨市南岗区",
            classNo: "CS111",
            major: "软件工程",
            college: "计算机学院",
            selectedCorse: "软件测试",
            remark: "对代码质量有追求"
        },
        {
            id: "12",
            stuNo: 1012,
            name: "卫十四",
            photo: "https://example.com/photo12.jpg",
            age: 23,
            phone: "13800000012",
            email: "weishisi@example.com",
            address: "西安市新城区",
            classNo: "CS112",
            major: "信息安全",
            college: "计算机学院",
            selectedCorse: "渗透测试",
            remark: "关注网络安全"
        },
        {
            id: "13",
            stuNo: 1013,
            name: "邱十五",
            photo: "https://example.com/photo13.jpg",
            age: 20,
            phone: "13800000013",
            email: "qiushi@example.com",
            address: "福州市鼓楼区",
            classNo: "CS113",
            major: "人工智能",
            college: "计算机学院",
            selectedCorse: "深度学习",
            remark: "热爱技术"
        },
        {
            id: "14",
            stuNo: 1014,
            name: "阮十六",
            photo: "https://example.com/photo14.jpg",
            age: 21,
            phone: "13800000014",
            email: "ruanshiliu@example.com",
            address: "厦门市思明区",
            classNo: "CS114",
            major: "计算机科学",
            college: "计算机学院",
            selectedCorse: "计算机网络",
            remark: "擅长沟通"
        },
        {
            id: "15",
            stuNo: 1015,
            name: "施十七",
            photo: "https://example.com/photo15.jpg",
            age: 22,
            phone: "13800000015",
            email: "shishiqi@example.com",
            address: "合肥市包河区",
            classNo: "CS115",
            major: "软件工程",
            college: "计算机学院",
            selectedCorse: "前端开发",
            remark: "对设计有热情"
        },
        {
            id: "16",
            stuNo: 1016,
            name: "贾十八",
            photo: "https://example.com/photo16.jpg",
            age: 23,
            phone: "13800000016",
            email: "jiashiba@example.com",
            address: "南宁市青秀区",
            classNo: "CS116",
            major: "信息安全",
            college: "计算机学院",
            selectedCorse: "信息安全管理",
            remark: "关注行业动态"
        },
        {
            id: "17",
            stuNo: 1017,
            name: "任十九",
            photo: "https://example.com/photo17.jpg",
            age: 20,
            phone: "13800000017",
            email: "renshiu@example.com",
            address: "沈阳市和平区",
            classNo: "CS117",
            major: "人工智能",
            college: "计算机学院",
            selectedCorse: "智能系统",
            remark: "思维敏捷"
        },
        {
            id: "18",
            stuNo: 1018,
            name: "袁二十",
            photo: "https://example.com/photo18.jpg",
            age: 21,
            phone: "13800000018",
            email: "yuanshiyu@example.com",
            address: "郑州市金水区",
            classNo: "CS118",
            major: "计算机科学",
            college: "计算机学院",
            selectedCorse: "数据挖掘",
            remark: "喜欢挑战"
        },
        {
            id: "19",
            stuNo: 1019,
            name: "段二十一",
            photo: "https://example.com/photo19.jpg",
            age: 22,
            phone: "13800000019",
            email: "duanshiyu@example.com",
            address: "济南市历下区",
            classNo: "CS119",
            major: "软件工程",
            college: "计算机学院",
            selectedCorse: "后端开发",
            remark: "注重代码质量"
        },
        {
            id: "20",
            stuNo: 1020,
            name: "苏二十二",
            photo: "https://example.com/photo20.jpg",
            age: 23,
            phone: "13800000020",
            email: "sushier@example.com",
            address: "昆明市五华区",
            classNo: "CS120",
            major: "信息安全",
            college: "计算机学院",
            selectedCorse: "网络攻防",
            remark: "热爱科研"
        }
    ];
    console.log("模拟获取学生数据",currentPage,pageSize)
    return {
        code: 200,
        data: {students, total: 18},
        message: 'success'
    }
}
// 模拟按学号或姓名查询学生数据
export const searchStudent = (keyword:string, currentPage:number, pageSize:number) => {
    console.log("模拟按学号或姓名查询学生数据",keyword, currentPage, pageSize)
    return {
        code: 200,
        data: {students: [
            {
                id: "1",
                stuNo: 1001,
                name: "张三",
                photo: "https://example.com/photo1.jpg",
                age: 20,
                phone: "13800000001",
                email: "zhangsan@example.com",
                address: "北京市海淀区",
                classNo: "CS101",
                major: "计算机科学",
                college: "计算机学院",
                selectedCorse: "数据结构",
                remark: "学习积极"
            },
        ], total: 1},
        message: 'success'
    }
}

// 模拟修改学生数据
export const updateStudent = (stu:IStudent)=>{
    console.log("模拟修改学生数据",stu)
    return {
        code: 200,
        data: null,
        message: 'success'
    }
}

// 模拟添加学生数据
export const addStudent = (stu:IStudent)=>{
    console.log("模拟添加学生数据",stu)
    return {
        code: 200,
        data: null,
        message: 'success'
    }
}
// 模拟删除学生数据
export const deleteStudent = (id:string)=>{
    console.log("模拟删除学生数据",id)
    return {
        code: 200,
        data: null,
        message: 'success'
    }
}